﻿namespace WMS6.Web.Billing
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class TariffQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlIsActive;
        protected DropDownList ddlIsActiveOper;
        protected DropDownList ddlTariffDescr;
        protected DropDownList ddlTariffID;
        protected HtmlForm F9040;
        protected HtmlInputHidden hdnActionID;
        protected HtmlHead Head1;
        protected Label lblIsActive;
        protected Label lblTariffDescr;
        protected Label lblTariffID;
        protected Label lblTarifft;
        protected HtmlLink mycss;
        protected ScriptManager ScriptManager1;
        protected TextBox txtTariffDescr;
        protected TextBox txtTariffID;

        protected void btnList_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("TariffList.aspx?action={0}&from=list", base.UrlEncode(this.hdnActionID.Value.Trim())), false);
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("TariffList.aspx?action=" + base.UrlEncode(this.hdnActionID.Value), false);
        }

        private void LoadDDl()
        {
            base.InitQueryDDL(this.ddlTariffID, 0);
            base.InitQueryDDL(this.ddlTariffDescr, 0);
            base.InitQueryDDL(this.ddlIsActiveOper, 0);
            base.InitIsActiveDDL(this.ddlIsActive, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            base.InitPage(this.Page);
            this.LoadDDl();
        }

        public string IsActive
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlIsActive.Text.Trim()))
                {
                    return base.GetParamsString(this.ddlIsActive.Text.Trim(), this.ddlIsActiveOper.SelectedValue);
                }
                return "";
            }
        }

        public string TariffDescr
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtTariffDescr.Text.Trim()))
                {
                    return base.GetParamsString(this.txtTariffDescr.Text.Trim(), this.ddlTariffDescr.SelectedValue);
                }
                return "";
            }
        }

        public string TariffID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtTariffID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtTariffID.Text.Trim(), this.ddlTariffID.SelectedValue);
                }
                return "";
            }
        }
    }
}

